const order = ['demo1', 'demo2', 'demo3']
const url1 = 'https://m.douban.com/rexxar/api/v2/subject_collection/movie_showing/items'
const url2 = 'https://m.douban.com/rexxar/api/v2/subject_collection/tv_hot/items'
const url3 = 'https://m.douban.com/rexxar/api/v2/subject_collection/tv_variety_show/items'

Page({
  data:{
    title:' '
  },
  input(e){
    console.log(e)
    this.setData({
      title:e.detail.value
    })
  },
  search(){
    wx.navigateTo({
      url: 'search?title='+this.data.title,
    })
  },
  onLoad() {
    var that = this
    wx.request({
      url: url1,
      // data: {

      // },
      // header: {
      //   'content-type': 'application/json' // 默认值
      // },
      success(result) {
        var res = result.data
        console.log('dy',res)
        that.setData({
          ref: res.subject_collection_items
        })
      }
    })

    wx.request({
      url: url2,
      data: {

      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(result) {
        var res = result.data
        console.log(res)
        that.setData({
          ret: res.subject_collection_items
        })
      }
    })
    wx.request({
      url: url3,
      data: {
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(result) {
        var res = result.data
        console.log(res)
        that.setData({
          rec: res.subject_collection_items
        })
      }
    })

  }

})